public class TestPerson {

    public static void main(String[] args) {

        setPerson sp = new setPerson("旧账",2025);
        sp.compare(new setPerson("旧账",2025));

    }

}


class  setPerson{
    String name;
    int age;

    public setPerson(String name, int age){
        this.name = name;
        this.age = age;
    }

    public void  compare(setPerson sp){
        if(this.name.equals(sp.name) && this.age == sp.age){
            System.out.println("相同");
        }else{
            System.out.println("不相同");
        }
    }

//    public  boolean TestPerson

}

//class TestPerson{
//
//}